﻿Public Class RcliConyCoop

    'Public Shared Function Añadir(ByVal descEmpresa As String, ByVal pcliConyCoop As EcliConyCoop) As Boolean
    '    Dim resultado As Boolean = False

    '    Dim options As New TransactionOptions
    '    options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
    '    options.Timeout = New TimeSpan(0, 2, 0)

    '    Using scope As New TransactionScope(TransactionScopeOption.Required, options)
    '        Try
    '            resultado = DcliConyCoop.Añadir(descEmpresa, pcliConyCoop)
    '            scope.Complete()
    '        Catch ex As Exception
    '            Throw
    '        End Try
    '    End Using

    '    Return resultado
    'End Function
    Public Shared Function SeleccionarConyugue(ByVal descEmpresa As String, ByVal idRelacion As Int32) As List(Of EcliConyCoop)
        Dim cliConyCoops As List(Of EcliConyCoop) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                cliConyCoops = DcliConyCoop.SeleccionarClienteConyugue(descEmpresa, idRelacion)
                If cliConyCoops Is Nothing Then cliConyCoops = New List(Of EcliConyCoop)
                'If DisplaySelect Then cliConyCoops.Insert(0, New EcliConyCoop("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return cliConyCoops
    End Function

    Public Shared Function SeleccionarClienteConyugue(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal idRelacion As Int32) As List(Of EcliConyCoop)
        Dim cliConyCoops As List(Of EcliConyCoop) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                cliConyCoops = DcliConyCoop.SeleccionarClienteConyugue(descEmpresa, idRelacion)
                If cliConyCoops Is Nothing Then cliConyCoops = New List(Of EcliConyCoop)
                'If DisplaySelect Then cliConyCoops.Insert(0, New EcliConyCoop("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return cliConyCoops
    End Function
    Public Shared Function SeleccionarClienteConyugueTemporal(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal idRelacion As Int32) As List(Of EcliConyCoop)
        Dim cliConyCoops As List(Of EcliConyCoop) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                cliConyCoops = DcliConyCoop.SeleccionarClienteConyugueTemporal(descEmpresa, idRelacion)
                If cliConyCoops Is Nothing Then cliConyCoops = New List(Of EcliConyCoop)
                'If DisplaySelect Then cliConyCoops.Insert(0, New EcliConyCoop("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return cliConyCoops
    End Function

End Class
